package com.all.widget.view;

import java.util.zip.Inflater;

import com.all.ui.R;

import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebSettings.PluginState;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SeekBar;

public class FlashView extends RelativeLayout {

	private String flashPath;
	private WebView flash_view;
	private ProgressBar play_progress;
	private SeekBar sound_progress;
	private ImageButton play;
	private ImageButton stop;
	
	private int width;
	private int height;
	private int bottom_height;
	private boolean playing;
	
	private Handler handler;
	private AudioManager audioManager;
	
	//构造方法，必有
	public FlashView(Context context, AttributeSet attrs) {
		super(context, attrs);
		onCreate();
	}
	
	//构造方法
	public FlashView(Context context) {
		super(context);
		onCreate();
	}

	// 初始化界面
	public void onCreate() {
		LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.flash_view, FlashView.this);
		width = ((Activity)getContext()).getWindowManager().getDefaultDisplay().getWidth();
		height = ((Activity)getContext()).getWindowManager().getDefaultDisplay().getHeight();
		
		//加载播放按钮
		play = (ImageButton) findViewById(R.id.flash_button_play_7495);
		play.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				
			}
		});
		
		flash_view = (WebView) findViewById(R.id.flash_web_view_7488);
		flash_view.getSettings().setJavaScriptEnabled(true); 
		flash_view.getSettings().setPluginState(PluginState.ON);
		flash_view.setWebChromeClient(new WebChromeClient()); 
		flash_view.getSettings().setAllowFileAccess(true);
		//flash_view.getSettings().setPluginsEnabled(true);
		flash_view.getSettings().setSupportZoom(true);
		flash_view.getSettings().setAppCacheEnabled(true);
	}

}
